<?php

namespace Keio\StudyBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Keio\StudyBundle\Entity\Document;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class PageController extends Controller
{


//Trang chủ và các trang thông tin
    public function homeAction()
    {
        return $this->render('KeioStudyBundle:Page:home.html.twig');
    }
    public function todoAction()
    {
        return $this->render('KeioStudyBundle:Page:todo.html.twig');
    }
    public function aieAction()
    {
        return $this->render('KeioStudyBundle:Page:aie.html.twig');
    }
    public function dashboardAction()
    {
        return $this->render('KeioStudyBundle:Page:adm_dashboard.html.twig');
    }
    public function uploadAction(){
    	//neu ko login thi ko dung duoc
    	$user_id  = $this->get('security.context')->getToken()->getUser()->getId();
    	if (is_null($user_id)){
    		$user_loged_in = 0;
    	}else {$user_loged_in = 1;}
		$path_upload = __DIR__.'/../../../../web';
		$lnkupload = $this->container->get('templating.helper.assets')->getUrl('upload');
		return $this->render('KeioStudyBundle:Page:upload.html.php', array(
            'path_upload'   => $path_upload,
            'lnkupload'     => $lnkupload,
            'user_loged_in' =>$user_loged_in
        ));
    }
}